package com.wanmait.demo.webcontroller.usercontroller;

import com.wanmait.demo.pojo.Town;
import com.wanmait.demo.service.TownService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class TownController {
    @Resource
    private TownService townService;
     @ResponseBody
    @RequestMapping("/districtnum")
    public List<Town> districtnum(String num){

           List<Town> towns= townService.selectalltown(Integer.parseInt(num));

           return towns;

    }


}
